import ajax from "../utils/ajax.js";

const apis = {};

//get查找数据
// apis.getfindByPay = data => {
//     return ajax({
//         url: "/api/Pay/findByPay",
//         method: "get",
//         data: data
//     });
// };

//post查找数据
apis.addOrder = data => {
    return ajax({
        url: "/api/order/addOrder",
        method: "post",
        data: data
    });
};
/**
 * 根据flag判断运营商
 * @param {*} data 
 * @returns 
 */
apis.findByParticulars = data => {
    return ajax({
        url: "/api/Particulars/findByParticulars",
        method: "get",
        data: data
    });
};

apis.findTeam = data => {
    return ajax({
        url: "/api/Account/findAccountZ",
        method: "get",
        data: data
    });
};
apis.findTeamNext = data => {
    return ajax({
        url: "/api/Account/findAccountNext",
        method: "get",
        data: data
    });
};
apis.findLog = data => {
    return ajax({
        url: "/api/Account/findIncomeRecord",
        method: "get",
        data: data
    });
};
apis.withdraw = data => {
    return ajax({
        url: "/api/Account/withdraw",
        method: "get",
        data: data
    });
};
apis.getCard = data => {
    return ajax({
        url: "/api/Account/getCard",
        method: "get",
        data: data
    });
};
apis.getQr = data => {
    return ajax({
        url: "/api/user/getCode?uniCode=jkjkljl",
        method: "get",
        data: data
    });
};
/**
 * 查询详情
 * @param {*} data 
 * @returns 
 */
apis.findDetails = data => {
    return ajax({
        url: "/api/Particulars/findDetails",
        method: "get",
        data: data
    });
};

apis.findByOrder = data => {
    return ajax({
        url: "/api/order/findByOrder",
        method: "get",
        data: data
    });
};
apis.addComplaint = data =>{
   return ajax({
    url: "/api/complaint/addComplaint",
    method: "get",
    data: data
   }); 
};
apis.uploadImg = data =>{
    return ajax({
     url: "/api/upload/uploadImg",
     method: "post",
     data: data
    }); 
 }
 apis.findAccountById = data =>{
     return ajax({
        url: "/api/Account/findAccount",
        method: "get",
        data: data 
     });
 }
 
 apis.zhifu = data =>{
    return ajax({
       url: "/api/pay/js",
       method: "get",
       data: data 
    });
}
apis.getPay = data =>{
    return ajax({
       url: "/api/pay/doMoney",
       method: "get",
       data: data 
    });
}

apis.findAccount2 = data =>{
    return ajax({
       url: "/api/Account/findAccount2",
       method: "get",
       data: data 
    });
}

apis.findByIsType = data =>{
    return ajax({
       url: "/api/Particulars/findByIsType",
       method: "get",
       data: data 
    });
}

apis.selectAll = data =>{
    return ajax({
       url: "/api/swiper/selectAll",
       method: "get",
       data: data 
    });
}

apis.findCommodityById = data =>{
    return ajax({
       url: "/api/commodity/findCommodityById",
       method: "get",
       data: data 
    });
}

apis.findByCommodity = data =>{
    return ajax({
       url: "/api/commodity/findByCommodity",
       method: "get",
       data: data 
    });
}

apis.addSite = data =>{
    return ajax({
       url: "/api/site/addSite",
       method: "get",
       data: data 
    });
}

apis.findById = data =>{
    return ajax({
       url: "/api/site/findById",
       method: "get",
       data: data 
    });
}

apis.updateSite = data =>{
    return ajax({
       url: "/api/site/updateSite",
       method: "get",
       data: data 
    });
}
/**
 * 根据用户id查询订单 state查询状态 isPay
 * @param {*} data 
 * @returns 
 */
apis.findAccountId = data =>{
    return ajax({
       url: "/api/spOrder/findAccountId",
       method: "get",
       data: data 
    });
}
/**
 * 根据id更改发货状态为已完成
 * @param {*} data 
 * @returns 
 */
apis.updateState = data =>{
    return ajax({
       url: "/api/spOrder/updateState",
       method: "post",
       data: data 
    });
}
/**
 * 根据未付款订单支付货款
 * @param {*} data 
 * @returns 
 */
apis.goPay = data =>{
    return ajax({
       url: "/api/order/goPay",
       method: "post",
       data: data 
    });
}
apis.paySuccess= data =>{
    return ajax({
        url: "api/pay/success",
        method: "get",
        data: data
    });
}
/**
 * 根据电话号查询
 * @param {*} data 
 * @returns 
 */
apis.findTel= data =>{
    return ajax({
       url: "/api/order/findTel",
       method: "get",
       data: data 
    });
}
/**
 * 根据用户id查询
 * @param {*} data 
 * @returns 
 */
 apis.findByAccount= data =>{
    return ajax({
       url: "/api/order/findByAccount",
       method: "get",
       data: data 
    });
}
/**
 * 申请退款
 * @param {*} data 
 * @returns 
 */
apis.updateRefund= data =>{
    return ajax({
       url: "/api/spOrder/updateRefund",
       method: "post",
       data: data 
    });
}
//客服
apis.findAfter= data =>{
    return ajax({
       url: "/api/findAfter",
       method: "get",
       data: data 
    });
}

export default apis;